package com.whcoding.designpatterns.pattern.factorypattern.factorymethod;

import com.whcoding.designpatterns.pattern.factorypattern.factorymethod.service.ICar;

/**
 * @program: spring-boot-learning
 * @description: 方法工厂模式:
 * @author: whcoding
 * @create: 2022-09-19 16:55
 **/
public class ConsumerTests {

	/**
	 * 操作步骤：
	 * 1.添加ICar接口、里面方法为carBrandName
	 *
	 * 2.添加ICar 接口的实现类，AudiCarImpl、BydCarImpl、TeslaCarImpl
	 *
	 * 3.再添加  CarFactory 工厂类(接口)，每个汽车品牌只生产自己的车辆
	 *
	 * 5.添加 CarFactory 接口的实现类, AudiCarFactory、BydCarFactory、TeslaCarFactory
	 *
	 *
	 *
	 * 消费者：通过特定的工厂，生产特定的车
	 *
	 *
	 * @param args
	 */
	public static void main(String[] args) {
		ICar audiCar = new AudiCarFactory().getCar();
		ICar teslaCar = new TeslaCarFactory().getCar();
		ICar bydCar = new BydCarFactory().getCar();

		audiCar.carBrandName();
		teslaCar.carBrandName();
		bydCar.carBrandName();

	}
}
